//
//  SwitchTableViewCell.m
//  QuDanOEM
//
//  Created by wmz on 2021/11/16.
//

#import "SwitchTableViewCell.h"

@implementation SwitchTableViewCell

- (void)hd_setupViews{
    @HDWeakify(self)
    self.switchSW.add_event(^(UIView * _Nonnull sender) {
        @HDStrongify(self)
        self.model.select = [self.switchSW isOn];
    });
}

- (void)setGNModel:(BaseCellModel*)data{
    self.model = data;
    self.lineView.hidden = !data.lineHidden;
    self.nameLB.add_text(GNFillEmpty(data.title))
    .add_font(data.titleFont)
    .add_textColor(data.titleColor);
    
    self.switchSW.on = data.isSelected;
}

@end
